const id = location.search.slice(1).split('=')[1];
console.log(id);
const dd = location.search.slice(1).split('=')[3]
console.log(dd);
$(function () {
    $.ajax({
        type: "post",
        url: 'http://127.0.0.1:3007/my/reserve/reserve',
        datatype: 'json',
        async: true,
        data: {
            Id: id
        },
        success: function (data) {
            console.log(data);
            let word = data.dataA[0]
            $(".content").append(word.content)
        }
    })
    $(".anniu").click(function () {
        var asd=location.search.slice(1).split('=')[1]
        $.ajax({
            type: "post",
            url: 'http://127.0.0.1:3007/my/hear/hear?id=' +id
            , async: true,
            data: {
                content: $('.pinglun').val(),
                author_id: asd,
                content_id: id
            },
            success: function (data) {
                console.log(data);
            }
        })
        $.ajax({
            type: "post",
            url: 'http://127.0.0.1:3007/my/hand/hand?id='+id+'author_id='+dd,
            success:function(data){
                console.log(data);
                $('.anniu').click(function(){
                    var hand =data.data
                    console.log(hand);
                    if(hand!=undefined && hand.length>0){
                        for(var i=0;i<hand.length;i++){
                            $('.ultxt').append(
                                '<li class="hand"'+'<p>'+hand[i].content+'</p>'+'</li>'
                                )
                        }
                        $('pinglun').val('')
                    }
                })
            }
        })
    })

})
